package cn.ryh.listener.annotation;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * @ClassName AnnotationSessionListener
 * @Description 使用@WebListener注解注册，实现HttpSessionListener接口,监听Session的创建与销毁
 * @Author RaoYH
 */
@WebListener
public class AnnotationSessionListener implements HttpSessionListener{
    @Override
    public void sessionCreated(HttpSessionEvent se) {

        System.out.println("AnnotationSessionListener 初始化");
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {

        System.out.println("AnnotationSessionListener 销毁");
    }
}
